<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>固定定位</title>
    <style>
        body{
            height: 2000px;
        }
        .box1{
            width: 200px;
            height: 200px;
            background-color: #bfa;
        }
        .box2{
            width: 200px;
            height: 200px;
            background-color: orange;
             /* 固定定位
                将元素position属性为fixed则开起元素的固定元素
                固定定位是特殊的绝对定位，因此与绝对定位特点大部分相同
                唯一不同的时
                固定定位永远参考于浏览器的视口

              */
              position: fixed;
              top: 0px;
              left: 0px;
          
        }
        .box3{
            width: 200px;
            height: 200px;
            background-color: yellow;
        }

        .box4{
            width: 400px;
            height: 400px;
            background-color: tomato;
        }
        .box5{
            width: 300px;
            height: 300px;
            background-color: aliceblue;
        }
        
     
    </style>
</head>
<body>
    
</body>
    <div class="box1">1</div>
    <div class="box4">
        4
        <div class="box5">
            5
            <div class="box2">2</div>
        </div>
    </div>
    
    <div class="box3">3</div>
</html>